package com.neusoft.ysu.npms.controller;


import com.neusoft.ysu.npms.pojo.Result;
import com.neusoft.ysu.npms.pojo.Risk;
import com.neusoft.ysu.npms.service.IRiskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@RestController
@RequestMapping("/risk")
public class RiskController {
    @Autowired
    IRiskService riskService;
    @RequestMapping("/add")
    public Result add(@RequestBody Risk risk) {riskService.add(risk);return Result.success();}
    @RequestMapping("/delete")
    public Result deleteRisk(@RequestBody Risk risk) {riskService.deleteRisk(risk);return Result.success();}
    @RequestMapping("/update")
    public Result updateRisk(@RequestBody Risk risk){riskService.updateRisk(risk);return Result.success();}
    @RequestMapping("getAll")
    public Result getAll(){riskService.selectAll();return Result.success();}
    @RequestMapping("findone")
    public Result findone(@RequestBody Risk risk){System.out.println(risk);riskService.findById(risk);return Result.success();}
}
